using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace TurbaconPhone
{
    class Explosion : ParticleEmitter
    {
        public Explosion(string textureName, Vector2 position)
            : base(textureName, position, Vector2.Zero, 0f, 0f, 3)
        { }

        protected override void CreateParticle()
        {
            float angle = (float)TurBacon.RandomBetween( -MathHelper.Pi, MathHelper.Pi);
            Vector2 v = new Vector2(
                (float)Math.Cos(angle) * TurBacon.RandomBetween(.1f, .2f),
                (float)Math.Sin(angle) * TurBacon.RandomBetween(.1f, .2f));
            float life = TurBacon.RandomBetween(0.5f,1.0f);
            float aV = TurBacon.RandomBetween(-MathHelper.PiOver4 / 2,MathHelper.PiOver4 / 2);


            Particle exp = new Particle(Texture, Pos, v, life);
            exp.Accelerating(v / life);
            exp.Rotating(angle, aV);
            exp.Resizing(0.20f, 1.05f);

            exp.FadeIO = true;
        }
    }
}
